using System;
using FytSoa.Common.Utils;
using System.ComponentModel.DataAnnotations;
using FytSoa.Application.Sys;
using FytSoa.Common.Enum;
using SqlSugar;

namespace FytSoa.Application.Erp;

/// <summary>
/// erp-付款信息
/// </summary>
public class ErpFinancePaymentDto : AppEntity
{
    /// <summary>
    /// 编号
    /// </summary>
    [Required]
    [StringLength(50)]
    public string Number { get; set; }

    /// <summary>
    /// 回款类型(采购/退货/其他)
    /// </summary>
    [Required]
    public int TypeId { get; set; } = 1;

    /// <summary>
    /// 采购订单编号
    /// </summary>
    [Required]
    public long PurchaseOrderId { get; set; }
    
    /// <summary>
    /// 采购订单信息
    /// </summary>
    public ErpPurchaseOrderSimpleDto PurchaseOrder { get; set; }

    /// <summary>
    /// 销售编号
    /// </summary>
    [Required]
    public long SellId { get; set; }

    /// <summary>
    /// 客户编号
    /// </summary>
    [Required]
    public long CustomerId { get; set; }

    /// <summary>
    /// 供应商编号
    /// </summary>
    [Required]
    public long SupplierId { get; set; }
    
    /// <summary>
    /// 供应商信息
    /// </summary>
    public ErpSupplierSimpleDto Supplier { get; set; }

    /// <summary>
    /// 付款金额
    /// </summary>
    [Required]
    public decimal Amount { get; set; }

    /// <summary>
    /// 付款方式
    /// </summary>
    [Required]
    public long ModeId { get; set; }
    
    /// <summary>
    /// 审批流程
    /// </summary>
    [Required]
    public long FlowId { get; set; } = 0;

    /// <summary>
    /// 审批流程详情
    /// </summary>
    [Required]
    public ErpFlowDto.ErpFlowSimpleDto Flow { get; set; } = new();
    
    /// <summary>
    /// 付款方式信息
    /// </summary>
    public SysCodeSimpleDto Code { get; set; }

    /// <summary>
    /// 付款时间
    /// </summary>
    [Required]
    public DateTime PayTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 备注说明
    /// </summary>
    public string Remark { get; set; }

    /// <summary>
    /// 审核状态
    /// </summary>
    [Required]
    public ErpAuditEnum Status { get; set; } = 0;

    /// <summary>
    /// 创建人
    /// </summary>
    public string CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Required]
    public DateTime CreateTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 更新人
    /// </summary>
    public string UpdateUser { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }


}